<template>
  <div>
    <div class="cardHeader padd-lr-20">
      <div class='float-right cursor'>
        <div v-if='show' @click='triggerShow(false)'>
          <i class='el-icon-arrow-up' /> 收起
        </div>
        <div v-else @click='triggerShow(true)'>
          <i class='el-icon-arrow-down' /> 展开
        </div>
      </div>
      <!-- 标题 -->
      <div v-if="$slots.title">
        <slot name="title" />
      </div>
    </div>
    <!-- 内容区 -->
    <div v-if="$slots.main" v-show='show' class="form-body padd-lr-20">
      <slot name="main" />
    </div>
  </div>

</template>

<script>
  export default {
    props: {
      show: {
        type: Boolean,
        default: true // 默认展开状态
      }
    },
    methods: {
      triggerShow(bool) {
        this.show = bool
      }
    }
  }
</script>
